//
//  UIViewController+YMAdditions.swift
//  YMToolKit
//
//  Created by YDWY on 2017/4/20.
//  Copyright © 2017年 YDWY. All rights reserved.
//

import Foundation
import UIKit


extension UIViewController {
    
    
    
    
    /// 控制器添加子控制器
    ///
    /// - Parameters:
    ///   - childController: 子控制器
    ///   - intoView: 父视图
    public func ym_add(childController : UIViewController , intoView : UIView){
    
        self.addChildViewController(childController)
        
        intoView.addSubview(childController.view)
        
        childController.didMove(toParentViewController: self)
    }
    
}
